package singleton;

import org.junit.jupiter.api.Test;

/**
 * @Author Zhang Chao
 * @Date 2021/5/20 10:06
 * @Version 1.0
 */


public class SingletonDemo2 {
    private static SingletonDemo2 singletonDemo;
    private SingletonDemo2() {
    }
    public static SingletonDemo2 getSingletonDemoInstance() {

        if (singletonDemo == null) {
            singletonDemo = new SingletonDemo2();
        }
        return singletonDemo;
    }
}



